<!DOCTYPE html>
<html>
<head>
    <title>商品分类表</title>
		<#include "/header.html">
    <link rel="stylesheet" href="${request.contextPath}/statics/css/bootstrap-table.min.css">
    <link rel="stylesheet" href="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.css">
    <script src="${request.contextPath}/statics/libs/bootstrap-table.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.min.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.bootstrap3.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/jquery.treegrid.extension.js"></script>
    <script src="${request.contextPath}/statics/plugins/treegrid/tree.table.js"></script>
  <link rel="stylesheet" href="${request.contextPath}/statics/plugins/iview/css/iview.css">
  <script src="${request.contextPath}/statics/plugins/iview/iview.min.js"></script>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("goods:goodscategory:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("goods:goodscategory:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("goods:goodscategory:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid" data-mobile-responsive="true" data-click-to-select="true">
            <thead>
            <tr>
                <th data-field="selectItem" data-checkbox="true"></th>
            </tr>
            </thead>
        </table>
        <div id="jqGridPager"></div>
    </div>


<div v-show="!showList" class="panel panel-default" >
    <div class="panel-heading" style="margin-bottom: 30px">{{title}}</div>
    <i-form ref="formValidate" :model="goodsCategory" :rules="ruleValidate" :label-width="80">
      <Form-item label="所属分类" prop="cateName">
        <i-input v-model="goodsCategory.cateName" @on-click="cateTree" icon="eye" readonly="readonly" style="width: 188px;"
                 placeholder="所属分类"/>
      </Form-item>

      <Form-item label="商品名称" prop="goodsId">
        <i-select style="width: 250px" v-model="goodsCategory.goodsId" filterable
                  remote
                  :label="goodsCategory.goodsName"
                  clearable="true"
                  :remote-method="getGoodsList"
                  :loading="isLoading">
          <i-option v-for="item in goodsList"
                    :value="item.id"
                    :key="item.id">{{item.name}}</i-option>
        </i-select>
      </Form-item>
      <Form-item>
        <i-button type="primary" @click="handleSubmit('formValidate')" style="background-color: #286090;">确定</i-button>
        <i-button type="warning" @click="reload" style="margin-left: 8px;background-color: #ec971f;"/>返回</i-button>
      </Form-item>
    </i-form>
  </div>
</div>
<div id="cateLayer" style="display: none;padding:10px;">
  <ul id="cateTree" class="ztree"></ul>
</div>
<script src="${request.contextPath}/statics/js/modules/goods/goodscategory.js?_${.now?long}"></script>
</body>
</html>
